#pragma once

#include <iostream>
#include <ctime>
#include <string>
#include <cstring>



//[日志等级] [时间] [日志信息] [__FILE__] [__LINE__]

// #define DEBUG  0
#define NORMAL 1
#define WARNING 2
#define ERROR 3
#define FATAL 4

void Log(std::string level, std::string msg, std::string fileName, int line)
{
#ifdef DEBUG
    if(strcmp(level.c_str(),"NORMAL") == 0)
        return;
#endif
    std::cout<<"["<< level <<"]" <<"["<< time(nullptr) <<"]" << "[" << msg << "]"\
        << "[" << fileName << "]" << "[" << line << "]"<<std::endl;
}

#define LOG(level, message) Log(#level,  message, __FILE__, __LINE__)


